home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / apps / cmapDoctor / cmapdoctor / Drawwin.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.5 KB  |  129 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /////////////////////////////////////////////////////////////
  18. //
  19. // Source file for Drawwin
  20. //
  21. //    This file generated by a BuilderXcessory.  DO NOT EDIT THIS FILE.
  22. //    TO ADD EXTENSIONS TO THIS CLASS, USE THE BUILDER XCESSORY
  23. //    TO CREATE A SUBCLASS.
  24. //
  25. //    This class is a user interface "component", as described
  26. //    in "Object-Oriented Programming with C++ and OSF/Motif",
  27. //    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
  28. //
  29. //
  30. /////////////////////////////////////////////////////////////
  31.  
  32.  
  33. #include "Drawwin.h" // Generated header file for this class
  34. #include <Xm/DrawingA.h> 
  35. #ifndef XmNrow    
  36. #define XmNrow "row"
  37. #endif    
  38. #ifndef XmNcolumn    
  39. #define XmNcolumn "column"
  40. #endif     
  41.  
  42.  
  43.  
  44.  
  45.  
  46. // These are default resources for widgets in objects of this class
  47. // All resources will be prepended by *<name> at instantiation,
  48. // where <name> is the name of the specific instance, as well as the
  49. // name of the baseWidget. These are only defaults, and may be overriden
  50. // in a resource file by providing a more specific resource name
  51.  
  52. String  Drawwin::_defaultDrawwinResources[] = {
  53.         NULL
  54. };
  55.  
  56. Drawwin::Drawwin(const char *name, Widget parent) : 
  57.          VkComponent(name) 
  58.     // Load any class-defaulted resources for this object
  59.  
  60.     setDefaultResources(parent, _defaultDrawwinResources  );
  61.  
  62.  
  63.  
  64.     // Create an unmanaged widget as the top of the widget hierarchy
  65.  
  66.     _baseWidget = _drawwin= XtVaCreateWidget ( _name,
  67.                                         xmDrawingAreaWidgetClass,
  68.                                         parent, 
  69.                                         NULL); 
  70.  
  71.     // install a callback to guard against unexpected widget destruction
  72.  
  73.     installDestroyHandler();
  74.  
  75.     XtAddCallback ( _w,
  76.                     XmNexposeCallback,
  77.                     &Drawwin::setExposedCallback,
  78.                     (XtPointer) this ); 
  79.  
  80.     XtAddCallback ( _w,
  81.                     XmNinputCallback,
  82.                     &Drawwin::drawInputCallback,
  83.                     (XtPointer) this ); 
  84.  
  85.  
  86. }
  87.  
  88. Drawwin::~Drawwin() 
  89. {
  90.     // Empty Destructor. Base class destroys widgets
  91. }
  92.  
  93. const char * Drawwin::className() // classname
  94. {
  95.     return ("Drawwin");
  96. }
  97.  
  98. void Drawwin::drawInputCallback (Widget w, XtPointer clientData, XtPointer callData) 
  99.     Drawwin* obj = (Drawwin *) clientData;
  100.  
  101.     obj->drawInput(w, callData);
  102. }
  103.  
  104. void Drawwin::setExposedCallback (Widget w, XtPointer clientData, XtPointer callData) 
  105.     Drawwin* obj = (Drawwin *) clientData;
  106.  
  107.     obj->setExposed(w, callData);
  108. }
  109.  
  110.  
  111.  
  112. void Drawwin::drawInput(Widget, XtPointer) 
  113. {
  114.     // Empty virtual function. Called from drawInputCallback.
  115.     // Derived classes can override.
  116. }
  117.  
  118. void Drawwin::setExposed(Widget, XtPointer) 
  119. {
  120.     // Empty virtual function. Called from setExposedCallback.
  121.     // Derived classes can override.
  122. }
  123.  
  124.  
  125.  
  126.